package com.serene.im.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.serene.im.mapper.SysUserMapper;
import com.serene.im.pojo.SysUser;
import com.serene.im.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户信息 服务实现类
 * </p>
 *
 * @author serene
 * @since 2019-12-22
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Autowired
    private SysUserMapper userMapper;


    /**
     * @param receiveId 发送者
     * @return
     */
    @Override
    public SysUser queryUserById(String receiveId) {
        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("main_user_id", receiveId);
        return userMapper.selectOne(queryWrapper);
    }
}
